# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=kismet2earth
pkgver=1.0
pkgrel=3
pkgdesc='A set of utilities that convert from Kismet logs to Google Earth .kml format.'
url='http://code.google.com/p/kismet2earth/'
license=('GPL')
groups=('blackarch' 'blackarch-wireless')
arch=('any')
source=("http://kismet2earth.googlecode.com/files/$pkgname.tar.gz")
sha512sums=('beee3f9877710dbafe250a612c2f1f946fafb657')

prepare() {
  cd $pkgname

  sed -i '1s/python/python2/' *.py
}

package(){
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  chmod +x "$pkgdir/usr/share/$pkgname/"{db2ge,k2db}.py

  ln -s /usr/share/kismet2earth/db2ge.py "$pkgdir/usr/bin/db2ge"
  ln -s /usr/share/kismet2earth/k2db.py "$pkgdir/usr/bin/k2db"
}

